package org.example.travel_web.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.example.travel_web.dto.ErrorCode;

/***
 * 自定义异常
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class RunException extends RuntimeException {
    private int code = 500;
    private ErrorCode errorCode;

    public RunException(ErrorCode errorCode) {
        super();
        this.errorCode = errorCode;
    }

    public RunException() {
        super();
    }

    public RunException(String message) {
        super(message);
    }

    public RunException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public RunException(Integer code) {
        this.code = code;
    }

    public RunException(String message, Throwable cause) {
        super(message, cause);
    }

    public RunException(Throwable cause) {
        super(cause);
    }

    public RunException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

}
